//战场控制范围图标

var warForceCapture = {
	forceSprites : [],
	
	Initialize : function(){
		this.forceSprites = [];
	},

	CreateForceCapture : function(){
		var forceCapture = new ForceCapture(campaign, tileEngine);
		for (var tileIndex = 0; tileIndex < forceCapture.forceMap.length; tileIndex++){
			var foundDiff = false;
			for (var neighborid in tileEngine.neighborCache[tileIndex]){
				var tileIndex_tmp = tileEngine.neighborCache[tileIndex][neighborid];
				if (forceCapture.forceMap[tileIndex] != forceCapture.forceMap[tileIndex_tmp]){
					foundDiff = true;
					break;
				}
			}
			if (foundDiff == false)
				continue;
			
			this.forceSprites[tileIndex] = new cc.Sprite(campaign.force[forceCapture.forceMap[tileIndex]].flag);
			this.forceSprites[tileIndex].attr(tileEngine.IndexToCoord(tileIndex));
			mainMap.node.addChild(this.forceSprites[tileIndex], 3);
		}
	},

	ClearForceCapture : function(){
		for (var idx = 0; idx < this.forceSprites.length; idx++){
			if (this.forceSprites[idx] != null){
				this.forceSprites[idx].removeFromParent();
				this.forceSprites[idx] = null;
			}
		}
	},
};